﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Manage.Traceability.ErrorCode
{
    public class ApiResult<T>
    {
        public ApiEnums Code { get; set; }
        public string Message {  get; set; }
        public T Data { get; set; }
        public static ApiResult<T> Success(string mes,T t)
        {
            return new ApiResult<T>()
            {
                Code = ApiEnums.Success,
                Message = mes,
                Data = t
            };
        }
        public static ApiResult<T> Fail(string mes)
        {
            return new ApiResult<T>()
            {
                Code = ApiEnums.Success,
                Message = mes,
            };
        }
    }
}
